import { Group } from './group';
import { MinerCount } from '@/utils/monitor/formatMinerCount';

export type Monitor = {
  id: number;
  mac: string;
  name: string;
  uid: number;
  ctime: number;
  mtime: number;
  miner_num: number;
  version: string;
  version_num: number;
  miner: string;
  temperature1: number;
  temperature2: number;
  card1: number;
  card2: number;
  card_open: number;
  hash: number;
  hottest: string;
  power: string;
  rid: number;
  groupList: Group[];
  osList: string[];
  status: number;
  minerCount: MinerCount;
};

export type MonitorInfo = {
  card1: number;
  card2: number;
  card_open: number;
  ctime: number;
  hash: number;
  id: number;
  last_error: number;
  last_hash: string;
  last_offline: number;
  last_online: number;
  last_stop: number;
  last_waring: 1;
  mac: string;
  miner: string;
  miner_num: number;
  mtime: number;
  name: string;
  os: string;
  recent_hash_time: number;
  remote: number;
  temperature1: number;
  temperature2: number;
  uid: number;
  version: string;
  version_num: number;
  minerCount: MinerCount;
};

export type MinerStatus = 'online' | 'waring' | 'error' | 'stop' | 'offline';
export interface OnlineMonitorModel {
  num: number;
  time: number;
  type: MinerStatus;
}

export type MonitorPageModel = { admin_phone: string; info: MonitorInfo };
